<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>登录-目的地运营集团数据管理平台</title>
<include file="Include:style" />
</head>
<body>
<div class="login-cont">
    <div class="form-box">
        <p class="warning"></p>
		<input type="hidden" name="login_type" value="{$login_type}">
        <input class="name" type="text" name="user_name" placeholder="用户名">
        <input class="password" type="password" name="password" placeholder="密码">
        <button class="animate" name="submit" type="button" disabled>登 录</button>
    </div>
</div>
<include file="Include:javascript" />
<script>
    $(function(){
        $(".login-cont").height($(window).height());
        $("input").bind('input propertychange', function() {  
            var name = $("[name='user_name']").val(),
                passw = $("[name='password']").val();
            if(name!='' && passw!=''){
                $("[name='submit']").addClass("active").attr('disabled',false);
            }else{
                 $("[name='submit']").removeClass("active").attr('disabled',true);
            }
        })
        $('.animate').click(function(){
            var name = $("[name='user_name']").val(),
                passw = $("[name='password']").val(),
				login_type = $("[name='login_type']").val();
            $.ajax({
				type:"POST",
				async:false,
				dataType:"json",
				url:"__APP__/Mobile/Index/do_login",
				data:{"username":name,"password":passw,"login_type":login_type},
				success:function(data){
					if(data.status==0){
						$('.warning').text(data.msg);
					}else{
						window.location=data.url;
					}
				}
			});
        })
        
    })
</script>
</body>
</html>